home *** CD-ROM | disk | FTP | other *** search
- // copyright 1993 Michael B. Johnson; some portions copyright 1994, MIT
- // see COPYRIGHT for reuse legalities
- //
-
- #import <appkit/appkit.h>
- #import <3Dkit/3Dkit.h>
-
- @interface WW3DCamera:N3DMovieCamera
- {
- id tclInterp;
- id theRotator;
- id theShader;
- id ambientLight, leftLight, rightLight;
- id currentShape;
- id statusText;
- int statusBufSize;
- char *statusBuf;
- char *ribName;
- int renderStyle;
- int movingRenderStyle;
- float shadingRate;
- NXColor ribColor;
- RtFloat tesselationVector[2];
- RtFloat lowRezTesselationVector[2];
-
- BOOL showSelectedShape, drawOriginForSelectedShape, useRendribInstead, binaryRIB;
- char *format;
-
- id image;
-
- List *otherLightList;
- List *ribCommandList;
-
- DPSTimedEntry animateTE;
- BOOL animateRotate;
- BOOL animateScale;
- BOOL animateTranslate;
-
- DPSTimedEntry renderTE;
- int renderCount;
- int renderAtMediumRate;
- int renderAtHighRate;
- float renderCheckTimeSlice;
-
- NXRect selectionRegion;
- float selectionWidthEpsilon, selectionHeightEpsilon;
- int trackballAffects;
- // avoid the stack allocation for timed entries
- NXPoint oldMouse, newMouse, dMouse;
- RtMatrix rmat, irmat;
- float scaleUpFactor,
- scaleDownFactor,
- translateXFactor,
- translateYFactor,
- translateZFactor,
- epsilon;
-
- BOOL defaultLightsInUse;
-
- RtFloat fStop, focalLength, focalDistance;
-
- BOOL inSynchWithTclInterp;
- BOOL evaluateInterpProc;
-
- RtFloat shutterOpenTime;
- RtFloat exposureLength; // shutterCloseTime always equals (shutterOpenTime + (exposureLength * exposureLengthFactor))
- RtFloat savedExposureLength; // this is so we can unset it for non-shot rendering
- RtFloat frameTimeIncrement; // when the frameNumber is incremented, the shutterOpenTime is incremented by this value
- RtFloat framesPerSecond;
- float shotLength; // how long, in seconds, is the shot
- float shotStartTime; // where, in the scene and in seconds, does the shot begin
- float exposureLengthFactor; // a 0 to 1 corresponding to what percentage of the possible time the shutter is left open during a shot
- int shotOutputType;
-
- BOOL shooting;
- BOOL dumpingToRIB;
- BOOL justResetExposureLength;
- BOOL justFinishedShooting;
-
- BOOL backgroundRendering;
- id sceneClock;
-
- BOOL drawWorldAsBox, drawCurrentAsBox;
-
- // support for direct interaction...
- BOOL updateShape;
- BOOL updateWhenTracking;
- BOOL changeSelectedShape;
-
- // 3DTextScene stuff
- char *fontName;
- float fontSize;
- float fontSpacing;
- float spacingFactor;
- float tabLength;
- float timeFactor;
- float sampleOffset;
-
- id runTimeSystem;
- }
-
- + initialize;
-
- - initFrame:(const NXRect *)r;
- - awake;
- - free;
-
- - setRunTimeSystem:newRTS;
-
- - getTransformMatrix:(RtMatrix)aMatrix;
-
- - removeAnimateTE;
-
- - (BOOL)backgroundRendering;
- - setBackgroundRenderingOff;
-
- - removeDefaultLights;
- - restoreDefaultLights;
- - removeLightNamed:(const char *)lightName;
-
- - delegate;
-
- - setImage:i;
- - setImageFile:(const char *)filename;
- - saveImage:sender;
-
- - turnOffCropWindow;
-
- - setSceneClock:newSceneClock;
-
- - dumpRIB:sender;
- - dumpRIBToFile:(char *)filename;
- - dumpShotToRIB:sender;
- - dumpShotToRIBFile:(const char *)longFilename;
- - dumpEve:sender;
- - dumpScene:sender;
- - dump3DTextScene:sender;
-
- - tclInterp;
-
- #define WW_TRACKBALL_WORLD_SHAPE 0
- #define WW_TRACKBALL_CAMERA 1
- #define WW_TRACKBALL_CURRENT_SHAPE 2
-
- - (int)trackballAffects;
- - takeTrackballAffectsFromMatrix:sender;
- - (int)trackballXYZ;
- - takeTrackballXYZFromMatrix:sender;
- - setNoCurrentShape:sender;
- - currentShape;
- - setCurrentShape:newCurrentShape;
- - (RtFloat)tesselation;
- - setTesselation:(RtFloat)newValue;
- - takeTesselation:sender;
- - (RtFloat)lowRezTesselation;
- - setLowRezTesselation:(RtFloat)newValue;
- - takeLowRezTesselation:sender;
- - (float)shadingRate;
- - takeShadingRate:sender;
-
- - (BOOL)showSelectedShape;
- - setShowSelectedShape:(BOOL)flag;
- - (BOOL)drawOriginForSelectedShape;
- - setDrawOriginForSelectedShape:(BOOL)flag;
-
- - takeStatusText:sender;
- - setStatusText:newStatusText;
- - statusText;
-
- - (BOOL)binaryRIB;
- - setBinaryRIB:(BOOL)n;
- - takeBinaryRIB:sender;
-
- - takeAmbientLightState:sender;
- - takeAmbientLightIntensity:sender;
- - takeAmbientLightColor:sender;
- - takeLeftLightState:sender;
- - takeLeftLightIntensity:sender;
- - takeLeftLightColor:sender;
- - takeRightLightState:sender;
- - takeRightLightIntensity:sender;
- - takeRightLightColor:sender;
-
- - takeRenderWorldAsBox:sender;
- - takeRenderCurrentAsBox:sender;
- - takeWorldIsVisible:sender;
- - takeCurrentIsVisible:sender;
-
- - (BOOL)renderWorldAsBox;
- - (BOOL)renderCurrentAsBox;
- - (BOOL)worldIsVisible;
- - (BOOL)currentIsVisible;
-
- - (BOOL)ambientLightState;
- - (RtFloat)ambientLightIntensity;
- - (NXColor)ambientLightColor;
- - (BOOL)leftLightState;
- - (RtFloat)leftLightIntensity;
- - (NXColor)leftLightColor;
- - (BOOL)rightLightState;
- - (RtFloat)rightLightIntensity;
- - (NXColor)rightLightColor;
-
- - updateShapeForInteraction:(BOOL)provideUpdates whenTracking:(BOOL)trackShape;
- - shouldChangeSelected:(BOOL)changeSelected;
-
- - mouseDown:(NXEvent *)theEvent;
-
- - (RtFloat)fStop;
- - (RtFloat)focalLength;
- - (RtFloat)focalDistance;
- - (RtFloat)shutterOpenTime;
- - (RtFloat)shutterCloseTime;
- - (float)frameTimeIncrement;
- - (float)frameTimeIncrement;
-
- - synchToSceneClock:sceneClock;
-
- - (BOOL)shooting;
-
- - removeAnimateTE;
- - animateRotate;
- - animateScale;
- - animateTranslate;
- void animateHandler(DPSTimedEntry teNumber, double now, void *userData);
- - removeRenderTE;
- - backgroundRender;
- void renderHandler(DPSTimedEntry teNumber, double now, void *userData);
-
- - setMovingRenderStyle:(int)s;
- - (int)movingRenderStyle;
- - setRenderStyle:(int)s;
- - (int)renderStyle;
- - (NXColor) backgroundColor;
- - setBackgroundColor:(NXColor)c;
-
- - (RtFloat)shutterOpenTime;
- - setShutterOpenTime:(RtFloat)newShutterOpenTime;
- - (RtFloat)shutterCloseTime;
- - (float)frameTimeIncrement;
- - (float)exposureLength;
- - (float)framesPerSecond;
- - (float)shotLength;
-
- - takeExposureLengthFactor:sender;
- - takeShotStartTime:sender;
- - (float)exposureLengthFactor;
- - (float)shotStartTime;
- - setExposureLengthFactor:(float)newExposureLengthFactor;
- - setShotStartTime:(float)newShotStartTime;
-
- - otherLightList;
- - addLocalLight:light usingPath:(const char *)aParentPath;
-
- - read:(NXTypedStream *)stream;
- - write:(NXTypedStream *)stream;
-
- @end
-
- // this camera has a tcl interp inside it that, in addition to
- // responding to all the standard tcl 7.3 commands, responds to:
- // dumpRIBToFile filename
- // display
- // backgroundColor [{r g b}]
- // fieldOfView [fov]
- // setEyeAtTowardRoll fromPoint toPoint aRollAngle
- // moveEyeBy sDistance tDistance uDistance
- // getEyePoint
- // getViewPoint
- // getRollAngle
- // getEyeAtTowardRoll
- // setSurfaceTypeForAll PointCloud|WireFrame|ShadedWireFrame|FacetedSolids|SmoothSolids
- // removeDefaultLights
- // restoreDefaultLights
- // lightList
- // addAmbientLight name intensity
- // addPointLight name fromX fromY fromZ intensity
- // addDistantLight name fromX fromY fromZ toX toY toZ intensity
- // addSpotLight name fromX fromY fromZ toX toY toZ coneAngle coneDelta beamDistribution intensity
- // removeLight name
-